package com.kang.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.kang.dao.PickingReturnIteminformationMapper;
import com.kang.pojo.PickingreturnIteminformation;
import com.kang.service.PickingreturnIteminformationService;

/**
 * 领料归还服务
 * 
 * @author ysq
 *
 */
@Service
public class PickingReturnIteminformationServiceImpl implements
		PickingreturnIteminformationService {
	/**
	 * 领料归还_物品
	 */
	@Resource
	private PickingReturnIteminformationMapper pickingReturnIteminformationMapper;

	/**
	 * 添加领料归还_物品信息
	 */
	@Override
	public int addPickingreturnIteminformation(
			PickingreturnIteminformation pickingreturnIteminformation) {
		return pickingReturnIteminformationMapper
				.addPickingreturnIteminformation(pickingreturnIteminformation);
	}

	/**
	 * 修改领料归还_物品信息
	 */
	@Override
	public int updatePickingreturnIteminformation(
			PickingreturnIteminformation pickingreturnIteminformation) {
		return 0;
	}

	/**
	 * 根据pickingreturnID查询领料归还_物品信息
	 */
	@Override
	public List<PickingreturnIteminformation> selectPickingreturnIteminformationByPickingreturnID(
			int pickingreturnID) {
		return pickingReturnIteminformationMapper
				.selectPickingreturnIteminformationByPickingreturnID(pickingreturnID);
	}

	/**
	 * 根据pickingreturnID删除所有pickingreturn_iteminformation信息
	 */
	@Override
	public int delPickingreturnIteminformation(Integer pickingreturnID) {
		return pickingReturnIteminformationMapper
				.delPickingreturnIteminformation(pickingreturnID);
	}

	/**
	 * 根据id修改item_detail的number数量（归还后加上数量）
	 * 
	 * @param id
	 * @param number
	 * @return
	 */
	@Override
	public int updateItem_detailNumberById(Integer id, Integer number) {
		return pickingReturnIteminformationMapper.updateItem_detailNumberById(
				id, number);
	}

}
